package com.suray.type;

/**
 * 子母车子车任务类型
 */
public enum SonRgvTaskType {
    INVALID(-1, "无效"),
    UNLOAD(1, "空载"),
    GET_CARGO(2, "取货"),
    PUT_CARGO(3, "放货"),
    GET_CARGO_AND_BACK(4, "出去取货并回母车"),
    PUT_CARGO_AND_BACK(5, "出去放货并回母车"),
    OUT_AND_GET_CARGO(6, "出去取货"),
    OUT_AND_PUT_CARGO(7, "出去放货"),
    BACK_MOTHER_RGV(10, "回母车"),
    NEW_TASK_MODE(11, "新任务模式"),
    ;

    private int value;
    private String des;

    SonRgvTaskType(int value, String des) {
        this.value = value;
        this.des = des;
    }

    public int getValue() {
        return value;
    }

    public static SonRgvTaskType parseType(int value) {
        for (SonRgvTaskType sonRgvTaskType : SonRgvTaskType.values()) {
            if (sonRgvTaskType.value == value) {
                return sonRgvTaskType;
            }
        }

        return INVALID;
    }

    @Override
    public String toString() {
        return des;
    }
}
